package director;

import abstractbuilder.AbstractBuilder;

/**
 * @Author buyee
 * @Date 2022/7/4 下午8:09
 */
public class Director {
    AbstractBuilder builder;

    public Director(AbstractBuilder builder) {
        this.builder = builder;
    }

    public String build(String title, String body) {
        writeTitle(title);
        writeBody(body);
        return builder.builder();
    }

    private void writeTitle(String title) {
        builder.makeTitle(title);
    }

    private void writeBody(String body) {
        builder.makeBody(body);
    }
}
